package com.banyuan;

import com.banyuan.controller.AccountController;
import com.banyuan.domain.Account;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.List;

public class SpringDemo1 {

    public static void main(String[] args) {
//        ApplicationContext ac = new ClassPathXmlApplicationContext("bean.xml");
//        Object person = ac.getBean("person");
//        System.out.println(person);

        ApplicationContext ac = new ClassPathXmlApplicationContext("bean.xml");
        AccountController accountController = ac.getBean("accountController", AccountController.class);
        List<Account> accountList = accountController.selectAll();
        System.out.println(accountList);

        Account account = accountController.selectById(1);
        System.out.println(account);
    }
}
